﻿<Controls:SinacorWindow
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d" 
  xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
  xmlns:Validation="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Validation;assembly=Sinacor.Infra.UI.Controls"
  xmlns:Edit="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.Edit;assembly=Sinacor.Infra.UI.Controls"
  x:Class="Sinacor.UI.Bovespa.Clientes.View.SmartClient.PesquisaClientes"
  Title="{DynamicResource Bovespa.Clientes.Label.PesquisaCliente}"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  ModuleId="ORD" 
  ModulePlus="False"
  WindowStartupLocation="CenterScreen"
  WindowState="Maximized" 
  >

    <Controls:SinacorExpanderContainer x:Name="ExpContainer">

        <!--Grid Definition - 02 linhas principais-->
        <Controls:SinacorExpanderContainer.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="4" />
            <RowDefinition Height="*" />
        </Controls:SinacorExpanderContainer.RowDefinitions>

        <!--Expander de Filtros de Pesquisa-->
        <Controls:SinacorExpander x:Name="exp1"  Header="{DynamicResource Bovespa.Clientes.Label.Pesquisa}" Grid.Row="0" IsExpanded="True">
            <Grid>
                <Controls:SinacorLabel HorizontalAlignment="Left" x:Name="labelCodigo" Content="{DynamicResource Infra.Sample.Label.Codigo}" VerticalAlignment="Top" Margin="0,0,0,0" Width="109" HorizontalContentAlignment="Left"/>
                <Controls:SinacorLabel HorizontalAlignment="Left" Margin="113,0,0,0" x:Name="labelApelido" Content="{DynamicResource Bovespa.Clientes.Label.Apelido}" VerticalAlignment="Top" Width="112" HorizontalContentAlignment="Left" />
                <Controls:SinacorLabel  Margin="229,0,0,0" x:Name="labelNomeCliente" Content="{DynamicResource Bovespa.Clientes.Label.NomeCliente}" VerticalAlignment="Top" HorizontalContentAlignment="Left" Width="250" HorizontalAlignment="Left" />
                <Controls:SinacorLabel Margin="483,0,0,0" x:Name="labelCpfCnpj" Content="{DynamicResource Bovespa.Clientes.Label.CPFCNPJCVM}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="200" HorizontalContentAlignment="Left"/>
                <Controls:SinacorInt32TextBox Integers="7" x:Name="textCodigo" HorizontalAlignment="Left" Margin="0,21,0,0" Width="109" VerticalAlignment="Top" AcceptsNegative="False" IsFormated="False" TabIndex="1"/>
                <Controls:SinacorTextBox x:Name="textApelido" HorizontalAlignment="Left" MaxLength="18" Margin="113,21,0,0" Width="112" VerticalAlignment="Top" TabIndex="2"/>
                <Controls:SinacorTextBox CausesValidation="False" x:Name="textNomeCliente" Margin="229,21,0,0" Width="250" MaxLength="80" HorizontalAlignment="Left" VerticalAlignment="Top" TabIndex="3" />
                <Controls:SinacorIdentificadorInvestidor Width="340" x:Name="textCPFCNPJ" ShowClienteEstrangeiro="False"  ShowCVM="True"  ShowOutros="False" ShowCPF="True" ShowCNPJ="True" CPFBind="{Binding CPFCNPJ}" CNPJBind="{Binding CPFCNPJ}" CVMBind ="{Binding CPFCNPJ}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="483,21,0,0" d:LayoutOverrides="VerticalAlignment" TabIndex="4"/>
                <Controls:SinacorButton CausesValidation="True" Click="ButtonBusca_Click" x:Name="ButtonBusca" HorizontalAlignment="Left" Margin="827,21,0,0" VerticalAlignment="Top" Content="{DynamicResource Bovespa.Clientes.Label.Pesquisar}" Width="102" IsDefault = "True" TabIndex="5" />
                <Controls:SinacorButton x:Name="buttonNovaBusca" HorizontalAlignment="Left" VerticalAlignment="Top" Click="btnNovaBusca_Click"  Icon="IconButtonNewSearch" Margin="934,21,0,0" TabIndex="6"/>
            </Grid>
        </Controls:SinacorExpander>

        <!-- Expander da Grid "Resultados de pesquisa"-->
        <Controls:SinacorExpander x:Name="exp2" Header="{DynamicResource Bovespa.Clientes.Label.Resultado}" Grid.Row="2" IsExpanded="True" AllowExpand="False">
            <Grid>
                <!--Grid Definition - 02 linhas principais-->
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="25" />
                </Grid.RowDefinitions>

                <!--Grid Dados de Cliente-->
                <Controls:SinacorDataGrid Grid.Row="0" x:Name="datagridDadosCliente" AllowDelete="False" ConfirmSelection="datagridDadosCliente_ConfirmSelection" ApplyingStyle="datagridDadosCliente_ApplyingStyle">
                    <!--Menu de Contexto-->
                    <Controls:SinacorDataGrid.ContextMenuTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <Controls:SinacorContextMenuItem x:Name="AceitaItem" Header="{DynamicResource Bovespa.Titulo.Label.Aceitar}" Click="Aceitar_Item_Click" IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorWindow}}, Path=IsEnableAceitar}" />
                            </StackPanel>
                        </DataTemplate>
                    </Controls:SinacorDataGrid.ContextMenuTemplate>
                    <!--Colunas da Grid-->
                    <Controls:SinacorDataGrid.Columns>
                        <Controls:Column Name="Codigo" DisplayMemberPath="Codigo" Title="Bovespa.Clientes.Label.Codigo" HorizontalCellAlignment="Right"  />
                        <Controls:Column Name="Digito" DisplayMemberPath="DigitoVerificador" Title="Bovespa.Clientes.Label.Dv" HorizontalCellAlignment="Right" />
                        <Controls:Column Name="Apelido" DisplayMemberPath="Apelido" Title="Bovespa.Clientes.Label.Apelido" HorizontalCellAlignment="Left" />
                        <Controls:Column Name="Nome" DisplayMemberPath="Nome" Title="Bovespa.Clientes.Label.NomeCliente" HorizontalCellAlignment="Left" />
                        <Controls:Column Name="CodigoOperacionalCVM" DisplayMemberPath="CodigoOperacionalCVM" Title="Bovespa.Clientes.Label.CodigoOperacionalCVM" HorizontalCellAlignment="Right" />
                        <Controls:Column Name="CpfCnpj" DisplayMemberPath="CPFCNPJ" Title="Bovespa.Clientes.Label.CPFCNPJ" HorizontalCellAlignment="Right" />
                        <Controls:Column Name="ComplementoNome" DisplayMemberPath="ComplementoNome" Title="Bovespa.Clientes.Label.ComplementoNome" HorizontalCellAlignment="Left" />
                        <Controls:Column Name="DataNascimentoFundacao" DisplayMemberPath="DataNascimentoFundacao" Title="Bovespa.Clientes.Label.NascimentoFundacao" HorizontalCellAlignment="Center" />
                        <Controls:Column Name="Dependencia" DisplayMemberPath="Dependencia" Title="Bovespa.Clientes.Label.Dependencia" HorizontalCellAlignment="Right" />

                        <Controls:Column Name="PessoaVinculada" Title="Bovespa.Clientes.Label.PessoaVinculada" DisplayMemberPath="isPessoaVinculada">
                            <Controls:Column.CellTemplate>
                                <DataTemplate>
                                    <Controls:SinacorCheckBox IsChecked="{Binding Path=isPessoaVinculada, Mode=OneWay}" IsEnabled="False" />
                                </DataTemplate>
                            </Controls:Column.CellTemplate>
                        </Controls:Column>

                        <Controls:Column Name="ContaMae" DisplayMemberPath="ContaMae" Title="Bovespa.Clientes.Label.ContaMae" HorizontalCellAlignment="Right" />

                        <Controls:Column Name="ClienteQualificado" DisplayMemberPath="isClienteQualificado" Title="Bovespa.Clientes.Label.ClienteQualificado">
                            <Controls:Column.CellTemplate>
                                <DataTemplate>
                                    <Controls:SinacorCheckBox IsChecked="{Binding Path=isClienteQualificado, Mode=OneWay}" IsEnabled="False" />
                                </DataTemplate>
                            </Controls:Column.CellTemplate>
                        </Controls:Column>

                        <Controls:Column Name="Bloqueado" DisplayMemberPath="isBloqueado" Title="Bovespa.Clientes.Label.Bloqueado">
                            <Controls:Column.CellTemplate>
                                <DataTemplate>
                                    <Controls:SinacorCheckBox IsChecked="{Binding Path=isBloqueado, Mode=OneWay}" IsEnabled="False" />
                                </DataTemplate>
                            </Controls:Column.CellTemplate>
                        </Controls:Column>

                        <Controls:Column Name="DescricaoBloqueio" DisplayMemberPath="DescricaoBloqueio" Title="Bovespa.Clientes.Label.DescricaoBloqueio" HorizontalCellAlignment="Left" />

                        <Controls:Column Name="Situacao" DisplayMemberPath="Situacao" Title="Bovespa.Clientes.Label.Situacao" HorizontalCellAlignment="Left"/>
                    </Controls:SinacorDataGrid.Columns>
                </Controls:SinacorDataGrid>

                <!--Legendas-->
                <StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal" DockPanel.Dock="Left" Margin="0,4,0,0">
                    <Controls:SinacorLabel Content="{DynamicResource Bovespa.Clientes.Label.Legenda}" x:Name="txtLegenda" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Left" Margin="0,0,0,0"/>
                    <Ellipse Fill="{DynamicResource BrushGridRowBusiness06}" Width="15" Height="15" StrokeThickness="0" Margin="0,0,0,0"/>
                    <Controls:SinacorLabel Content="{DynamicResource Bovespa.Clientes.Label.ClienteDesativado}" x:Name="txtBlSinalizacaoInativo"  HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Left" Margin="0,0,0,0"/>
                    <Ellipse Fill="{DynamicResource BrushGridRowBusiness01}" StrokeThickness="0" Width="15" Height="15" Margin="0,0,0,0"/>
                    <Controls:SinacorLabel Content="{DynamicResource Bovespa.Clientes.Label.ClienteAtivo}" x:Name="TXTbLSinalizacaoAtivo" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Left" Margin="0,0,0,0" />
                </StackPanel>
            </Grid>
        </Controls:SinacorExpander>

    </Controls:SinacorExpanderContainer>

</Controls:SinacorWindow>